home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / coding / 80x86 / code32.lzh / HEXB2BCD.RT < prev    next >
Text File  |  1993-01-09  |  619b  |  30 lines

  1. public  _cvhexb2bcd
  2.  
  3. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  4. ; Convers hex AL to BCDpacked AX
  5. ; In:
  6. ;   AL - hex num to convert
  7. ; Out:
  8. ;   AX - BCDpacked number
  9. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  10. _cvhexb2bcd:
  11.         push bx
  12.         push cx
  13.         xor cx,cx
  14.         xor ah,ah
  15.         mov bl,100
  16.         div bl
  17.         or cl,al
  18.         shl cx,4
  19.         shr ax,8
  20.         mov bl,10
  21.         div bl
  22.         or cl,al
  23.         shl cx,4
  24.         or cl,ah
  25.         mov ax,cx
  26.         pop cx
  27.         pop bx
  28.         ret
  29.  
  30.